package com.itheima.springbootrequestresponse.controller;

import com.itheima.springbootrequestresponse.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * ResponseController
 *
 * @author liliudong
 * @version 1.0
 * @description
 * @date 2023/7/7 15:23
 */
@RestController
public class ResponseController {

    /**
     * 序列化
     * @return
     */
    @GetMapping("/list")
    public Result list() {
        ArrayList<String> strings = new ArrayList<String>() {
            {
                add("张三");
                add("李四");
                add("王二");
                add("麻子");
            }
        };

        return Result.success(strings);
    }
}
